package com.ff.xyh.front.service;

import com.ff.xyh.common.entity.post.PostDelete;
import com.ff.xyh.common.entity.post.PostJoiner;
import com.ff.xyh.common.entity.post.PostReply;
import com.ff.xyh.common.entity.result.ResultObject;
import com.ff.xyh.common.qo.message.RoomMessageQuery;
import com.ff.xyh.common.vo.post.PostShopVo;
import com.ff.xyh.common.vo.post.PostTravelVo;
import com.ff.xyh.common.qo.post.PostShopQuery;
import com.ff.xyh.common.qo.post.PostTravelQuery;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
 * @Auther FF
 * @Date 2022年 11月 25日
 * @Time 22:09
 */

public interface PostFeignService {

    /* 拼购 */

    /**
     * 获取帖子的信息 封装成PostShopVo
     * @param postShopQuery
     * @return
     */
    ResultObject getPostShopCondition(PostShopQuery postShopQuery) ;

    /**
     * 获取帖子的信息 封装成PostTravelVo
     * @param postTravelQuery
     * @return
     */
    ResultObject getPostTravelCondition(PostTravelQuery postTravelQuery) ;


    /**
     * 通过id和type获取帖子并封装成对应的前端类
     * @param id
     * @param type
     * @return
     */
    ResultObject getPost(String id, int type) ;


    /**
     * 添加拼购帖
     * @param postVo
     * @return
     */
    ResultObject addPostShop(PostShopVo postVo) ;

    /**
     * 添加旅游帖
     * @param postVo
     * @return
     */
    ResultObject addPostTravel(PostTravelVo postVo) ;

    /**
     * 修改拼购帖
     * 请求头中包含isImgChanged=1则更新照片集
     * @param postVo
     * @param request
     * @return
     */
    ResultObject updatePostShop(PostShopVo postVo, HttpServletRequest request) ;

    /**
     * 修改旅游帖
     * @param postVo
     * @param request
     * @return
     */
    ResultObject updatePostTravel(PostTravelVo postVo, HttpServletRequest request) ;


    ResultObject addPostReply(PostReply postReply) ;

    ResultObject deletePostReply(String id);




    /**
     * 上传封面 需要在request中加入type 如果为第二次提交  则需要加入uuid
     * @param multipartFile
     * @param request
     * @return
     */
    ResultObject uploadPostCover(MultipartFile multipartFile,  HttpServletRequest request) ;

    ResultObject uploadPostCover(MultipartFile multipartFile,  String type, String uuid) ;


    ResultObject uploadPostImg(MultipartFile multipartFile, String type, String uuid) ;

//    ResultObject uploadPostImgs(MultipartFile[] multipartFiles,  HttpServletRequest request) ;

    /**
     * 上传照片集
     * @param multipartFiles
     * @param type
     * @param uuid
     * @return
     */
    ResultObject uploadPostImgs(MultipartFile[] multipartFiles, String type, String uuid) ;


    /**
     * 修改照片集文件
     * 需要请求头中包含isImgChanged=1
     * @param multipartFiles
     * @param request
     * @return
     */
    ResultObject uploadChangedImgs(MultipartFile[] multipartFiles, HttpServletRequest request);


    /**
     * 用户自行删帖
     * 临时删除 后续定时任务删除照片、回复集、参与者、房间、群聊消息等
     * @param postDelete
     * @return
     */
    ResultObject deletePostByUser(PostDelete postDelete) ;

    ResultObject deleteImgInPath(String path);

    ResultObject deleteImgsInPath(String path);

    /**
     * 发布失败
     * @param postId
     * @param type
     * @param uuid
     * @return
     */
    ResultObject failedAdd(String postId, String type, String uuid);

    ResultObject addPostJoiner(PostJoiner joiner);

    ResultObject hasPostJoiner(String postId, Integer postType, String userId);

    ResultObject changeJoinerUserNumber(String postId, Integer postType, String userId, Integer number);

    ResultObject deletePostJoiner(String postId, Integer postType, String userId);

    ResultObject cancelPostJoiner(String postId, Integer postType, String userId);

    ResultObject acceptPostJoiner(String postId, Integer postType, String userId);

    ResultObject refusePostJoiner(String postId, Integer postType, String userId);

    ResultObject isUserSpeakable(String postId, Integer postType, String userId);

    ResultObject getRoomMessage(long currentPage, long pageSize, String roomId, String messageId);

    ResultObject getRoomMessageListCondition(RoomMessageQuery roomMessageQuery);
}
